﻿@model IList<BlogPostYearModel>
@using Nop.Web.Models.Blogs
@if (Model.Count > 0)
{
    <div class="block block-blog-archive">
        <div class="title">
            @T("Blog.Archive")
        </div>
        <div class="clear">
        </div>
        <div class="listbox">
            <ul id="blogMonthList">
                @foreach (var yearItem in Model)
                {
                    <li class="year">@(yearItem.Year)
                        <ul id="year@(yearItem.Year)">
                            @foreach (var monthItem in yearItem.Months)
                            {
                                <li><a href="@Url.RouteUrl("BlogByMonth", new { month = yearItem.Year + "-" + monthItem.Month })">@(new DateTime(yearItem.Year, monthItem.Month, 1).ToString("MMMM"))
                                    (@(monthItem.BlogPostCount))</a> </li>
                            }
                        </ul>
                    </li>
                }
            </ul>
        </div>
    </div>
    
    
}